package vip.liux.contracts.models.pay;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import vip.liux.contracts.shared.enums.pay.PayWalletBizType;
import vip.liux.domain.entities.auditing.CreationAuditedEntity;

import java.math.BigDecimal;

/**
 * 会员钱包流水 DO
 *
 * @author jason
 */
@Getter
@Setter
@Entity
@Table(name = "pay_wallet_transaction")
@Accessors(chain = true)
public class PayWalletTransaction extends CreationAuditedEntity<Long> {

    /**
     * 流水号
     */
    private String seqNo;

    /**
     * 钱包编号
     * <p>
     * 关联 {@link PayWallet#getId()}
     */
    private Long walletId;

    /**
     * 关联业务分类
     * <p>
     * 枚举 {@link PayWalletBizType#getValue()}
     */
    private PayWalletBizType bizType;

    /**
     * 关联业务编号
     */
    private String bizId;

    /**
     * 流水说明
     */
    private String title;

    /**
     * 交易金额，单位元
     * <p>
     * 正值表示余额增加，负值表示余额减少
     */
    private BigDecimal price;

    /**
     * 交易后余额，单位元
     */
    private BigDecimal balance;
}
